<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
    <h2>登录</h2>
    <form method="post">
    用户名: <input type="text" name="userName" value="" placeholder="请输入用户名" />
        <br /><br />
        密&nbsp;&nbsp;码&nbsp;:&nbsp;<input type="password" name="pwd" value="" placeholder="请输入密码"/>
        <br /><br />
        <input type="submit" id="" value="登入" />
    </form>
</body>
</html>
<?php
$userName = $_POST['userName'];
$password = $_POST['pwd'];
if ($userName=="admin"&&$password="123456"){
    echo   '<script>
            alert("登录成功");
            location="./uploadimg1.php";
          </script>';
    setcookie('Token',md5($userName+$password,time()),time()+24*3600);